package com.cloudtasks;
import com.cloudtasks.R;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;

import com.google.zxing.client.result.ParsedResult;
import com.google.zxing.Result;
import com.google.zxing.client.result.ProductParsedResult;

import android.app.Activity;
import android.app.TabActivity;
import android.os.Bundle;
import android.widget.TabHost;
import android.content.Intent;

public class OptionTabsInitializer extends TabActivity {
	
	public static OptionTabsInitializer context;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try{
	        context = this;
        	TabHost tabHost = getTabHost();       
	      
	        Intent listIntent = new Intent(this, ListGroupActivity.class);
	        Intent addIntent = new Intent(this, AddGroupActivity.class);
	        Intent scanIntent = new Intent(this, ScanMenuActivity.class);
	        
	        listIntent.putExtras(getIntent().getExtras());
	        addIntent.putExtras(getIntent().getExtras());
	        scanIntent.putExtras(getIntent().getExtras());   
	        tabHost.setCurrentTab(0); 		
			
	        tabHost.addTab(tabHost.newTabSpec("tab1")
					.setIndicator("LIST")
			        .setContent(listIntent));     
			tabHost.addTab(tabHost.newTabSpec("tab2")
					.setIndicator("ADD")
			        .setContent(addIntent));
			tabHost.addTab(tabHost.newTabSpec("tab3")
					.setIndicator("SCAN")
					.setContent(scanIntent));			
        }
        catch(Exception e){
        	MyTools.displayToastMessage(this, e.toString());
        }
    }

    
}